package com.example.aotdemo;

import jakarta.annotation.PreDestroy;
import org.springframework.beans.factory.DisposableBean;

public class MyDisposableBean implements DisposableBean {
    @Override
    public void destroy() throws Exception {
        System.out.println("destroy销毁方法");
    }
    @PreDestroy
    public void preDestroy(){
        System.out.println("preDestroy销毁方法");
    }
    public void cleanUp(){
        System.out.println("自定义销毁方法");
    }
}
